package chapter04.example16;
//定义类Animal
class  Animal{
    public void shout(){
        System.out.println("喵喵喵");
    }
}
//Dog类
class Dog extends Animal{
    public void shout(){
        System.out.println("汪汪汪汪");
    }
    public void eat(){
        System.out.println("吃骨头");
    }
}
//定义测试类
public class example16 {
    public static void main(String[] args){
        Dog dog=new Dog();//创建Dog对象
        Animal an=dog;
        an.shout();
    }
}
